import { createRouter, createWebHashHistory } from "vue-router";
const register = () => import("./components/Register.vue");
const login = () => import("./components/Login.vue");
const forgetPassword = () => import("./components/ForgetPassword.vue");

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "login",
    component: login,
  },
  {
    path: "/register",
    name: "register",
    component: register,
  },
  {
    path: "/forgetPassword",
    name: "forgetPassword",
    component: forgetPassword,
  },
  {
    path: "/menu",
    component: () => import("./components/Menu.vue"),
    children: [
      {
        path: "/menu/count",
        component: () => import("./components/Count.vue"),
      },
      {
        path: "/menu/home",
        component: () => import("./components/Home.vue"),
      },
    ],
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes,
});
export default router;
